package com.oauth.google.client.ui.picasa;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.HasWidgetInfo;
import com.oauth.google.client.ui.PicasaResources;

public class PicasaInfo extends Composite implements HasWidgetInfo {

	private static PicasaInfoUiBinder uiBinder = GWT.create(PicasaInfoUiBinder.class);

	interface PicasaInfoUiBinder extends UiBinder<Widget, PicasaInfo> {
	}

	public static final Long applicationId = 6l;
	public static final String applicationName = "Picasa";

	@UiField
	GooglePicasaPanel mainPanel;

	@UiField
	Image icon;

	@UiField
	Image image;

	public PicasaInfo() {
		initWidget(uiBinder.createAndBindUi(this));
		image.setResource(PicasaResources.INSTANCE.image());
		icon.setResource(PicasaResources.INSTANCE.icon());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#init()
	 */
	@Override
	public void init() {
		mainPanel.init();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getName()
	 */
	@Override
	public String getName() {
		return applicationName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getIcon()
	 */
	@Override
	public Image getIcon() {
		return icon;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getWidgetImage()
	 */
	@Override
	public Image getWidgetImage() {
		return image;
	}

	@Override
	public Widget getWidgetUI() {
		return mainPanel;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.HasWidgetInfo#getId()
	 */
	@Override
	public Long getId() {
		return applicationId;
	}
}